﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LY.Entity.SearchEntity;
using LY.Interface;
using LY.DataAccess.Repository;
using LY.Entity.PageSearch;
using LY.Entity;
using LY.Entity.Entities;


namespace LY.Business.ServiceImpl
{
    public class MemberLogService : IMemberLogService
    {
        MemberLogRepository _repo;
        public MemberLogService()
        {
            _repo = new MemberLogRepository();
        }

        /// <summary>
        /// 模块列表
        /// </summary>
        /// <param name="view"></param>
        /// <returns></returns>
        public PagedList<U_MemberLoginLog> QueryMemberLoginList(PageView view)
        {
            return _repo.QueryMemberLoginList(view);
        }
        public PagedList<U_MemberLoginLog> QueryMemberLoginList(MemberLoginSearch search, PageView view)
        {
            return _repo.QueryMemberLoginList(search,view);
        }

        /// <summary>
        /// 删除模块信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteModule(int id)
        {
            return _repo.DeleteModule(id);
        }

        /// <summary>
        /// 检索模块信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public S_Module GetModule(int? id)
        {
            return _repo.GetModule(id);
        }



        /// <summary>
        /// 新增登录日志
        /// </summary>
        /// <param name="inves"></param>
        /// <returns></returns>
        public void AddMemberLoginLog(U_MemberLoginLog memberloginlog)
        { 
            _repo.Insert(memberloginlog);
        }


         /// <summary>
         /// 获取最后登陆的日志
         /// </summary>
         /// <param name="memberId"></param>
         /// <returns></returns>
        public U_MemberLoginLog GetLastLoginLog(int memberId)
        {
           return  _repo.GetLastLoginLog(memberId);
        }
    }
}
